package it.mauriziobasile.dietarapida;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.Hashtable;

/**
 * 
 * @author Maurizio Basile
 */
public class Alimento {

    private String CAT_ID;
    private String ALI_ID;
    private String ALI_DESC;
    private String NOME_SCIENT;
    private String PER_EDI;
    private String ACQUA;
    private String PROTEINE;
    private String LIPIDI;
    private String COLESTEROLO;
    private String CARBOIDRATI;
    private String AMIDO;
    private String ZUCC_SOL;
    private String ALCOOL;
    private String FIBR_TOT;
    private String FIBR_SOL;
    private String FIBR_INS;
    private String ENER_KCAL;
    private String ENER_KJOU;
    private String PERC_PROT;
    private String PERC_LIPI;
    private String PERC_CARB;
    private String PERC_ALCO;
    private String SODIO;
    private String POTASSIO;
    private String FERRO;
    private String CALCIO;
    private String FOSFORO;
    private String Mg;
    private String Zn;
    private String Cu;
    private String Se;
    private String TIAMINA;
    private String RIBOFLAVINA;
    private String NIACINA;
    private String VIT_A;
    private String VIT_C;
    private String VIT_E;
    private String TOTA_SAT;
    private String C4_0_C10_0;
    private String C12_0;
    private String C14_0;
    private String C16_0;
    private String C18_0;
    private String C20_0;
    private String C22_0;
    private String TOTA_MON;
    private String C14_1;
    private String C16_1;
    private String C18_1;
    private String C20_1;
    private String C22_1;
    private String TOTA_POL;
    private String C18_2;
    private String C18_3;
    private String C20_4;
    private String C20_5;
    private String C22_6;
    private String RAPP_PS;
    private String ACID_FIT;

    public Alimento(Hashtable<String, String> nut){
        for (String nutriente : nut.keySet()) {
            set(nutriente,nut.get(nutriente));
        }
    }

    public void set(String nutriente,String value){
        Method setter;
        try {
            setter = this.getClass().getMethod("set" + nutriente, String.class);
            setter.invoke(this, new Object[] { value }); 
        } catch (SecurityException e) {
            DietaRapidaApp.logger.severe("Eccezione "+e.getMessage());
        } catch (NoSuchMethodException e) {
            DietaRapidaApp.logger.severe("Eccezione "+e.getMessage());
        } catch (IllegalArgumentException e) {
            DietaRapidaApp.logger.severe("Eccezione "+e.getMessage());
        } catch (IllegalAccessException e) {
            DietaRapidaApp.logger.severe("Eccezione "+e.getMessage());
        } catch (InvocationTargetException e) {
            DietaRapidaApp.logger.severe("Eccezione "+e.getMessage());
        }
        
    } 
    
    
    public String get(String nutriente) {
        Method getter;
        String value=null;
        try {
            getter = this.getClass().getMethod("get" + nutriente);
            value = (String) getter.invoke(this, new Object[] {});
        } catch (SecurityException e) {
            DietaRapidaApp.logger.severe("Eccezione "+e.getMessage());
        } catch (NoSuchMethodException e) {
            DietaRapidaApp.logger.severe("Eccezione "+e.getMessage());
        } catch (IllegalArgumentException e) {
            DietaRapidaApp.logger.severe("Eccezione "+e.getMessage());
        } catch (IllegalAccessException e) {
            DietaRapidaApp.logger.severe("Eccezione "+e.getMessage());
        } catch (InvocationTargetException e) {
            DietaRapidaApp.logger.severe("Eccezione "+e.getMessage());
        }
        return value;
    }

    public String getCAT_ID() {
        return CAT_ID;
    }

    public void setCAT_ID(String cATID) {
        CAT_ID = cATID;
    }

    public String getALI_ID() {
        return ALI_ID;
    }

    public void setALI_ID(String aLIID) {
        ALI_ID = aLIID;
    }

    public String getALI_DESC() {
        return ALI_DESC;
    }

    public void setALI_DESC(String aLIDESC) {
        ALI_DESC = aLIDESC;
    }

    public String getNOME_SCIENT() {
        return NOME_SCIENT;
    }

    public void setNOME_SCIENT(String nOMESCIENT) {
        NOME_SCIENT = nOMESCIENT;
    }

    public String getPER_EDI() {
        return PER_EDI;
    }

    public void setPER_EDI(String pEREDI) {
        PER_EDI = pEREDI;
    }

    public String getACQUA() {
        return ACQUA;
    }

    public void setACQUA(String aCQUA) {
        ACQUA = aCQUA;
    }

    public String getPROTEINE() {
        return PROTEINE;
    }

    public void setPROTEINE(String pROTEINE) {
        PROTEINE = pROTEINE;
    }

    public String getLIPIDI() {
        return LIPIDI;
    }

    public void setLIPIDI(String lIPIDI) {
        LIPIDI = lIPIDI;
    }

    public String getCOLESTEROLO() {
        return COLESTEROLO;
    }

    public void setCOLESTEROLO(String cOLESTEROLO) {
        COLESTEROLO = cOLESTEROLO;
    }

    public String getCARBOIDRATI() {
        return CARBOIDRATI;
    }

    public void setCARBOIDRATI(String cARBOIDRATI) {
        CARBOIDRATI = cARBOIDRATI;
    }

    public String getAMIDO() {
        return AMIDO;
    }

    public void setAMIDO(String aMIDO) {
        AMIDO = aMIDO;
    }

    public String getZUCC_SOL() {
        return ZUCC_SOL;
    }

    public void setZUCC_SOL(String zUCCSOL) {
        ZUCC_SOL = zUCCSOL;
    }

    public String getALCOOL() {
        return ALCOOL;
    }

    public void setALCOOL(String aLCOOL) {
        ALCOOL = aLCOOL;
    }

    public String getFIBR_TOT() {
        return FIBR_TOT;
    }

    public void setFIBR_TOT(String fIBRTOT) {
        FIBR_TOT = fIBRTOT;
    }

    public String getFIBR_SOL() {
        return FIBR_SOL;
    }

    public void setFIBR_SOL(String fIBRSOL) {
        FIBR_SOL = fIBRSOL;
    }

    public String getFIBR_INS() {
        return FIBR_INS;
    }

    public void setFIBR_INS(String fIBRINS) {
        FIBR_INS = fIBRINS;
    }

    public String getENER_KCAL() {
        return ENER_KCAL;
    }

    public void setENER_KCAL(String eNERKCAL) {
        ENER_KCAL = eNERKCAL;
    }

    public String getENER_KJOU() {
        return ENER_KJOU;
    }

    public void setENER_KJOU(String eNERKJOU) {
        ENER_KJOU = eNERKJOU;
    }

    public String getPERC_PROT() {
        return PERC_PROT;
    }

    public void setPERC_PROT(String pERCPROT) {
        PERC_PROT = pERCPROT;
    }

    public String getPERC_LIPI() {
        return PERC_LIPI;
    }

    public void setPERC_LIPI(String pERCLIPI) {
        PERC_LIPI = pERCLIPI;
    }

    public String getPERC_CARB() {
        return PERC_CARB;
    }

    public void setPERC_CARB(String pERCCARB) {
        PERC_CARB = pERCCARB;
    }

    public String getPERC_ALCO() {
        return PERC_ALCO;
    }

    public void setPERC_ALCO(String pERCALCO) {
        PERC_ALCO = pERCALCO;
    }

    public String getSODIO() {
        return SODIO;
    }

    public void setSODIO(String sODIO) {
        SODIO = sODIO;
    }

    public String getPOTASSIO() {
        return POTASSIO;
    }

    public void setPOTASSIO(String pOTASSIO) {
        POTASSIO = pOTASSIO;
    }

    public String getFERRO() {
        return FERRO;
    }

    public void setFERRO(String fERRO) {
        FERRO = fERRO;
    }

    public String getCALCIO() {
        return CALCIO;
    }

    public void setCALCIO(String cALCIO) {
        CALCIO = cALCIO;
    }

    public String getFOSFORO() {
        return FOSFORO;
    }

    public void setFOSFORO(String fOSFORO) {
        FOSFORO = fOSFORO;
    }

    public String getMg() {
        return Mg;
    }

    public void setMg(String mg) {
        Mg = mg;
    }

    public String getZn() {
        return Zn;
    }

    public void setZn(String zn) {
        Zn = zn;
    }

    public String getCu() {
        return Cu;
    }

    public void setCu(String cu) {
        Cu = cu;
    }

    public String getSe() {
        return Se;
    }

    public void setSe(String se) {
        Se = se;
    }

    public String getTIAMINA() {
        return TIAMINA;
    }

    public void setTIAMINA(String tIAMINA) {
        TIAMINA = tIAMINA;
    }

    public String getRIBOFLAVINA() {
        return RIBOFLAVINA;
    }

    public void setRIBOFLAVINA(String rIBOFLAVINA) {
        RIBOFLAVINA = rIBOFLAVINA;
    }

    public String getNIACINA() {
        return NIACINA;
    }

    public void setNIACINA(String nIACINA) {
        NIACINA = nIACINA;
    }

    public String getVIT_A() {
        return VIT_A;
    }

    public void setVIT_A(String vITA) {
        VIT_A = vITA;
    }

    public String getVIT_C() {
        return VIT_C;
    }

    public void setVIT_C(String vITC) {
        VIT_C = vITC;
    }

    public String getVIT_E() {
        return VIT_E;
    }

    public void setVIT_E(String vITE) {
        VIT_E = vITE;
    }

    public String getTOTA_SAT() {
        return TOTA_SAT;
    }

    public void setTOTA_SAT(String tOTASAT) {
        TOTA_SAT = tOTASAT;
    }

    public String getC4_0_C10_0() {
        return C4_0_C10_0;
    }

    public void setC4_0_C10_0(String c4_0C10_0) {
        C4_0_C10_0 = c4_0C10_0;
    }

    public String getC12_0() {
        return C12_0;
    }

    public void setC12_0(String c12_0) {
        C12_0 = c12_0;
    }

    public String getC14_0() {
        return C14_0;
    }

    public void setC14_0(String c14_0) {
        C14_0 = c14_0;
    }

    public String getC16_0() {
        return C16_0;
    }

    public void setC16_0(String c16_0) {
        C16_0 = c16_0;
    }

    public String getC18_0() {
        return C18_0;
    }

    public void setC18_0(String c18_0) {
        C18_0 = c18_0;
    }

    public String getC20_0() {
        return C20_0;
    }

    public void setC20_0(String c20_0) {
        C20_0 = c20_0;
    }

    public String getC22_0() {
        return C22_0;
    }

    public void setC22_0(String c22_0) {
        C22_0 = c22_0;
    }

    public String getTOTA_MON() {
        return TOTA_MON;
    }

    public void setTOTA_MON(String tOTAMON) {
        TOTA_MON = tOTAMON;
    }

    public String getC14_1() {
        return C14_1;
    }

    public void setC14_1(String c14_1) {
        C14_1 = c14_1;
    }

    public String getC16_1() {
        return C16_1;
    }

    public void setC16_1(String c16_1) {
        C16_1 = c16_1;
    }

    public String getC18_1() {
        return C18_1;
    }

    public void setC18_1(String c18_1) {
        C18_1 = c18_1;
    }

    public String getC20_1() {
        return C20_1;
    }

    public void setC20_1(String c20_1) {
        C20_1 = c20_1;
    }

    public String getC22_1() {
        return C22_1;
    }

    public void setC22_1(String c22_1) {
        C22_1 = c22_1;
    }

    public String getTOTA_POL() {
        return TOTA_POL;
    }

    public void setTOTA_POL(String tOTAPOL) {
        TOTA_POL = tOTAPOL;
    }

    public String getC18_2() {
        return C18_2;
    }

    public void setC18_2(String c18_2) {
        C18_2 = c18_2;
    }

    public String getC18_3() {
        return C18_3;
    }

    public void setC18_3(String c18_3) {
        C18_3 = c18_3;
    }

    public String getC20_4() {
        return C20_4;
    }

    public void setC20_4(String c20_4) {
        C20_4 = c20_4;
    }

    public String getC20_5() {
        return C20_5;
    }

    public void setC20_5(String c20_5) {
        C20_5 = c20_5;
    }

    public String getC22_6() {
        return C22_6;
    }

    public void setC22_6(String c22_6) {
        C22_6 = c22_6;
    }

    public String getRAPP_PS() {
        return RAPP_PS;
    }

    public void setRAPP_PS(String rAPPPS) {
        RAPP_PS = rAPPPS;
    }

    public String getACID_FIT() {
        return ACID_FIT;
    }

    public void setACID_FIT(String aCIDFIT) {
        ACID_FIT = aCIDFIT;
    }
}
